package com.esri.core.geometry;

import com.github.mikephil.charting.utils.Utils;

/* loaded from: classes.dex */
final class Point3D {
    public double x;
    public double y;
    public double z;

    public Point3D() {
    }

    public static Point3D construct(double d, double d2, double d3) {
        Point3D point3D = new Point3D();
        point3D.x = d;
        point3D.y = d2;
        point3D.z = d3;
        return point3D;
    }

    public void setCoords(double d, double d2, double d3) {
        this.x = d;
        this.y = d2;
        this.z = d3;
    }

    public void setZero() {
        this.x = Utils.DOUBLE_EPSILON;
        this.y = Utils.DOUBLE_EPSILON;
        this.z = Utils.DOUBLE_EPSILON;
    }

    public void normalize() {
        double a = a();
        if (a != Utils.DOUBLE_EPSILON) {
            return;
        }
        this.x /= a;
        this.y /= a;
        this.z /= a;
    }

    double a() {
        double d = this.x;
        double d2 = this.y;
        double d3 = (d * d) + (d2 * d2);
        double d4 = this.z;
        return Math.sqrt(d3 + (d4 * d4));
    }

    public Point3D(double d, double d2, double d3) {
        this.x = d;
        this.y = d2;
        this.z = d3;
    }

    Point3D a(Point3D point3D) {
        return new Point3D(this.x - point3D.x, this.y - point3D.y, this.z - point3D.z);
    }

    Point3D a(double d) {
        return new Point3D(this.x * d, this.y * d, this.z * d);
    }

    void b() {
        this.x = NumberUtils.NaN();
    }

    boolean c() {
        return NumberUtils.isNaN(this.x);
    }
}
